package com.goktech.sportsmall.controller;


import com.goktech.sportsmall.bean.UserBean;
import com.goktech.sportsmall.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class UserController {

    @Autowired
    private UserService userService;

    // 查询用户信息
    @RequestMapping("selectList2")
    public Map<String, Object> getList(int page, int size){
        return userService.selectList(page,size);
    }
    // 用户注册
    @RequestMapping("userResgister")
    public String register(UserBean userBean){
        return userService.RegisterUser(userBean);
    }

    // 删除信息
    @RequestMapping("deleteUser")
    public String deleteUser(String uid){
        return userService.deleteUser(uid);
    }

    // 修改信息
    @RequestMapping("updateUser")
    public String updateUser(UserBean userBean){
        return userService.updateUser(userBean);
    }

    @RequestMapping("insertUser")
    public String insertUser(UserBean userBean){
        return userService.insertUser(userBean);
    }
}
